from ability.cloud import CloudImage
from django.conf import FILE_CHARSET_DEPRECATED_MSG 
from django.core.management.base import BaseCommand
from tencentcloud.cvm.v20170312 import cvm_client, models


class Command(BaseCommand):
    help = 'import knowledges from point/* '

    def handle(self, *args, **options):
      cl = CloudImage(imageurl='centos7-server-python2.7')
      Filter = models.Filter()
      Filter.Name = 'image-name'
      Filter.Values = ['ubuntu20.04.1-desktop.ova']
      Filters = [Filter]
      # Filter1 = models.Filter()
      # Filter1.Name = 'image-type'
      # Filter1.Values = 'PRIVATE_IMAGE'
      # Filters.append(Filter1)
      print(cl.describeImages(Filters))
      print(cl.describeImagesByName('ubuntu20.04.1-desktop.ova'))